package handler

import (
	"reg-service/models"

	"github.com/gin-gonic/gin"
)

func List(c *gin.Context) {
	var reg []models.Reg
	models.DB.Find(&reg)
	var total int64
	models.DB.Model(&models.Reg{}).Count(&total)
	c.JSON(200, gin.H{
		"code":  200,
		"msg":   "ok",
		"data":  reg,
		"total": total,
	})
	return
}
